1. Field of the Invention
The present invention relates generally to an apparatus and method for orienting an image. More particularly, the present invention is an apparatus and method for rotating a captured image to an orientation corresponding to an imaging subsystem's orientation at the time in which the image was captured.
2. Description of the Background Art
When a digital camera captures an image of an object, the camera's frame of reference with respect to the object produces a desired image orientation. Two conventional image orientations exist, namely, a landscape orientation and a portrait orientation. Referring now to FIG. 1A, a prior art graphical representation of an object in a landscape orientation is shown, in which the image's width is greater than its height. Referring also now to FIG. 1B, a prior art graphical representation of the object in a portrait orientation is shown, in which the image's height is greater than its width.
In a digital camera, an image sensor is comprised of light-sensitive devices, such as charge-coupled devices (CCD), that convert an optical image into a set of electrical signals. Referring now to FIG. 1C, a prior art image sensor is shown having a 480 row by 640 column matrix of light collecting pixels. The image sensor is orientated within a body of the digital camera so that a first row of pixels (i.e. row r1) corresponds to the bottom of an upright and level digital camera. This image sensor orientation is required since as an optical image passes through a conventional camera lens it is inverted. The image sensor in a color digital camera typically consists of an array of green (G), red (R) and blue (B) pixels. Alternative embodiments include sensors detecting cyan, magenta, yellow and green as is typically used in video cameras. Other image sensor configurations are also used. The pixels that comprise the image sensor are arranged into various patterns or formats. A common image sensor format is called a Bayer pattern. The Bayer pattern format is defined as a pixel pattern comprised of 50% green-light responsive pixels, 25% red-light responsive pixels and 25% blue-light responsive pixels arranged in alternating rows of “GRGRGR” and “BGBGBG,” as shown in FIG. 1C. Throughout this specification, “G” means “green,” “R” means “red,” and “B” means “blue.”
Once an image is captured by the digital camera, a set of pixel signals corresponding to the image received by the pixels is processed by an image processing algorithm. Image processing routines are conventionally designed to process pixel signals line-by-line, conforming to a specific and unchanging pixel pattern format. Thus, image sensors manufactured with the Bayer pixel pattern format will be coupled to image processing routines specifically designed to accept pixel signals in alternating sequences of “GRGRGR” and “BGBGBG.” Due to possible imperfections in the outer rows and columns of pixels that make up the image sensor, conventional digital cameras sometimes have image sensors large enough so that one or more lines of pixels at the sides of the image sensor can be ignored.
Referring now to FIG. 1D, a prior art graphical representation is shown of the object as captured in the portrait orientation and output upon an image display 100. The image display 100 is typically a conventional stand-alone, personal computer CRT having a top 102, a right side 104, a left side 106 and a bottom 108.
As previously described, the image processing routines within digital cameras are conventionally designed to process pixel signals on a line-by-line basis according to only one pixel pattern format. Thus, conventional digital cameras process images as if they were always in a landscape format. In the presentation of the landscape image of FIG. 1A upon the image display, the “TOP” (i.e. “top portion”) of the landscape image would correspond to the top 102 of the FIG. 1D image display 100. Such an orientation for landscape images on the image display 100 is quite natural and is acceptable for ease of viewing the image. However, the presentation of the portrait image of FIG. 1B upon the image display results in the “TOP” of the portrait image corresponding to either the right side 104 or the left side 106 of the image display 100, depending on how the user had rotated the digital camera. FIG. 1D explicitly shows the case where the “TOP” of the portrait image corresponds to the right side 104 of the image display 100. This “sideways” orientation for portrait images on the image display 100 is unacceptable and unnatural. This undesirable by-product of conventional digital cameras requires that the user rotate portrait images so that they are presented in a more natural and upright viewing angle on the image display 100. It should be noted that this problem also exists for digitized images from conventional film cameras. Traditional rotation methods also have the disadvantage of requiring two blocks of memory to rotate a stored image.
What is needed is an apparatus and method that efficiently and automatically rotates a stored photographic image to correspond to the orientation in which the photographic image was captured.